package ent.parent.com.parent;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.pp.ent.base.BaseActivity;
import com.pp.ent.core.manage.UIHandler;
import com.pp.ent.db.DbManager;
import com.pp.ent.view.annotation.ContentView;
import com.pp.ent.view.annotation.Inject;
import com.pp.ent.view.annotation.OnClick;
import com.pp.ent.view.annotation.ViewInject;

@ContentView(R.layout.activity_main)
public class MainActivity extends BaseActivity {
    @ViewInject(R.id.tex_view)
    private TextView textView;
    @Inject
    private LoginService loginService;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        textView.setText("test");
        loginService.login();
        DbManager.init(this,"ent.parent.com.parent","test");

    }
    @OnClick({R.id.tex_view})
    private void onClick(View view){
        switch (view.getId()){
            case R.id.tex_view:
                Toast.makeText(this,"Hello,I am test",Toast.LENGTH_SHORT).show();
                break;
        }
    }
    @UIHandler(UIConfig.ON_LOGIN_RESPONSE)
    private void loginRes(boolean result){
        Toast.makeText(this,"Hello,I am loginRes result"+result,Toast.LENGTH_SHORT).show();
    }
}
